package com.igeek.compus.study.menu.entity;

import lombok.Data;

@Data
public class Menu {
    private Integer id;
    private String menuName;
    private String imageUrl;
    private String url;
    private Integer serial;
    private Integer isDel;

    private Integer page;// 前端传多少页
    private Integer limit;// 每页展示多少条数据
    private Integer pageIndex;

    public Integer getPageIndex() {
        if(page != null && limit != null) {
            return (page - 1) * limit;
        }
        return pageIndex;
    }

    @Override
    public String toString() {
        return "Menu{" +
                "id=" + id +
                ", menuName='" + menuName + '\'' +
                ", imageUrl='" + imageUrl + '\'' +
                ", url='" + url + '\'' +
                ", serial=" + serial +
                ", isDel=" + isDel +
                '}';
    }
}
